#include<stdio.h>
#include<stdlib.h>
#include<time.h>

#define N 20

void bubble_sort(int arr[], int n);
int  main(int argc, char *argv[])
{
	int arr1[N] = {0};
	int arr2[N] = {0};
	int i;

	srand(time(NULL));
	for(i = 0; i < N; i++){
		arr1[i] = rand()%100;
		arr2[i] = arr1[i];
	}

	bubble_sort(arr2, N);
	for(i = 0; i < N; i++){
		printf("%d ", arr2[i]);
	}
	printf("\n");

	return 0;
}


void bubble_sort(int arr[], int n) {
	int temp;
    for (int i = 0; i < n - 1; i++) {  
        for (int j = 0; j < n - 1 - i; j++) {  
            if (arr[j] > arr[j + 1]) {  
                temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }
        }
    }
}

